 begintalkscript;

 variables;

	///***Mercenary***///

 begintalknode 1;
	state = -1;
	nextstate = 1;
	question = "Merc";
	text1 = "_Halt! Who goes there?_ The man pointing the crossbow at you is in his thirties. He has a mean look on him and a face that says that he's killed before and he won't mind doing it again. He doesn't seem nervous at all.";

 begintalknode 2;
	state = 1;
	nextstate = -1;
	condition = get_flag(2,7) == 1;
	question = "Calamity.";
	action = END_TALK;
	text1 = "The man lowers his crossbow. _So, you know how the right words. Good for you. Guess you want to have a little talk with Vitendo, huh? You can find him way back there. Now beat it!_";

 begintalknode 3;
	state = 1;
	nextstate = 2;
	condition = get_flag(2,7) == 0 && get_flag(1,15) == 2;
	question = "Uh, regicide.";
	text1 = "_Where the hell'd you pick that one?_ Just when you think he's going to shoot, the man next to him whispers something to him. _A little far away from Sattle aren't we? Tell me why I shouldn't just shoot you right now?_";

 begintalknode 4;
	state = 1;
	nextstate = -1;
	question = "Who are you? Why are you here?";
	text1 = "_Wrong answer pal. Death to the Empire and all that._";
	action = END_TALK;
	code = make_town_hostile();
		set_flag(13,5,5);
 break;

 begintalknode 5;
	state = 2;
	nextstate = -1;
	question = "We were just exploring, we were going to Sattle.";
	text1 = "The man doesn't lower his crossbow. _You were just exploring, entered a cave and had the patience to find the right combination of switches? Just go right now and don't come back 'til you have the right password!_";
	action = END_TALK;
	code = set_flag(13,5,3);
 break;

 begintalknode 8;
	state = -1;
	nextstate = 9;
	question = "Merc.";
	text1 = "The man with the crossbow is still looking at the entrance of the cave. He doesn't grant you a single word.";
	text5 = "_What?_";
	action = INTRO;

 begintalknode 9;
	state = 9;
	nextstate = 10;
	question = "Why did you join the rebels?";
	text1 = "The man turns his head to you. _Well isn't that nice! Someone's trying to get to know their comrades in arms. Don't bother! I'm here for the money._ He turns his head away.";

 begintalknode 10;
	state = 10;
	nextstate = -1;
	question = "You're a mercenary?";
	text1 = "The man turns his head at you again. His expression tells you that you are the most annoying thing in his world right now, then he turns his head away.";

		///***Vitendo***///

 begintalknode 20;
	state = -1;
	nextstate = 20;
	question = "Vitendo";
	text1 = "The man greets you hurriedly. You take a look at his clothes. He is as ragtag as the rest of the rebels. _Ye're the new people, eh? I'm Vitendo the leader of the Rebels._";
	text2 = "_I'll answer any questions ye might have, but make it quick. We have a job for ye._";
	text5 = "Vitendo waits for your questions.";
	action = INTRO;

 begintalknode 21;
	state = 20;
	nextstate = 21;
	condition = get_flag(13,6) == 0;
	question = "You have a job for us?";
	text1 = "Vitendo grins. _A bit surprised are we? Yeah, we have a job for you._ He takes a look at your equipment. _A job I think ye might pull off. It's all related to the reason why ye were allowed in our headquarters so hastily._";
	text2 = "_It also explains why we're using a damp cave as our headquarters._ Vitendo sullenly throws some more wood in his fire. _I'm no fool. I know we can't leave the Empire without a fight. I also know that we can't win that fight, unless we have an edge._";
	text3 = "_I figured out what we needed months ago and my brother Horendo was the key for the success of my plan. My plan was summoning and controlling demons._";

 begintalknode 22;
	state = 21;
	nextstate = -1;
	question = "Let me guess: the demons weren't easy to control.";
	text1 = "You receive a blank stare. _Yes._";

 begintalknode 23;
	state = 21;
	nextstate = -1;
	question = "Tell me about Horendo.";
	text1 = "_My older brother Horendo is the wizard who is sadly walking aimlessly in these caverns. That wizard here found him to be adept at magic and sent him to be schooled. I wrote a letter to him asking for help and he came._";

 begintalknode 24;
	state = 21;
	nextstate = 22;
	question = "What did the summoned demons do?";
	text1 = "_Summoned demon, we only summoned one. Unfortunately, we summoned a way too powerful one. I figured ordinary demons wouldn't do, so Horendo suggested we should summon a, what was it? A haakai. Anyway, he thought he could control it._";
	text2 = "_The demon just laughed and did something to Horendo that turned him the way he is now. Then it started summoning other demons. Of course we tried to fight them, but they were too numerous and we couldn't even harm the big demon._";
	text3 = "_It chased us from our fort as forced us to retreat here._";
	action = SET_SDF 13 11 1;

 begintalknode 25;
	state = 22;
	nextstate = 20;
	question = "What can I do?";
	text1 = "_Our fort is in the small valley north of here. No doubt the demon uses it as its camp. I've noticed yer equipment and to me ye look like experienced adventurers. I want you to get inside the fort and fight yer way to the demon._";
	text2 = "_Once there we'll help ye fight it._";
	action = SET_SDF 13 6 1;

 begintalknode 26;
	state = -1;
	nextstate = 20;
	question = "Vitendo";
	text1 = "The man seemingly relaxes. _No doubt, ye've noticed what's been happening in Faerengrove. Towns under siege, I'll tell ye we're responsible for the carnage. But please, before ye kill me. I'd like to give ye a job to make things better._";
	code = set_town_status(13,1);
 break;

 begintalknode 27;
	state = 20;
	nextstate = -1;
	condition = get_flag(13,10) == 1;
	question = "You got some nerve you bastard! Die!";
	text1 = "The man seems terrified, but defends himself.";
	code = make_town_hostile();
 break;

 begintalknode 28;
	state = 20;
	nextstate = 24;
	condition = get_flag(13,10) != 1 && get_flag(13,6) > 0 && get_flag(13,5) != 5;
	question = "Tell me about your troops and their morale.";
	text1 = "_Understandably, their morale is not good. Over half of the survivors left when we retreated from the fortress. I'm not sure how long the rest will stay. Some of them are mercenaries and we're running out of money._";

 begintalknode 29;
	state = 24;
	nextstate = -1;
	question = "Can you tell me something about that mercenary with the crossbow?";
	text1 = "_Him? I don't even know his name. He's not very talkative, but he can shoot straight, so what do I care?_";

 begintalknode 30;
	state = 24;
	nextstate = -1;
	question = "Can you tell me something about Asp?";
	text1 = "_Ah yes, Asp. I tell ye she's got every reason to hate the Empire. When she was a little girl, her parents and her older brother were thrown to Avernum. Political reasons. Asp stayed with her second brother, but he was killed by Empire troops._";
	text2 = "_'Rebellious spirit' they said. She was then put to a home somewhere south. There they tried to break her, raising her to believe her family members were evil people and deserved their fate. She didn't buy that._";
	text3 = "_I don't know much about what happened to her in that home, but she returned to Faerengrove full of rage._";

 begintalknode 31;
	state = 24;
	nextstate = -1;
	question = "Can you tell me something about Horendo?";
	text1 = "_My older brother Horendo is the wizard who is sadly walking aimlessly in these caverns. That wizard here found him to be adept at magic and sent him to be schooled. I wrote a letter to him asking for help and he came._";

 begintalknode 32;
	state = 24;
	nextstate = -1;
	question = "Can you tell me something about that solid character with Asp?";
	text1 = "_We just call him Solid. His real name's Derik, or something. Used to serve in the army, during the Avernum war. Witnessed first hand the cruelty of the Empire troops. He is a soldier and can take on any man._";

 begintalknode 33;
	state = 22;
	nextstate = 25;
	condition = get_flag(6,11) != 0;
	question = "Hold on a second! You summoned a powerful HAAKAI?! How stupid are you!? Do you know what your demons did to Grimson?";
	text1 = "Vitendo shifts uneasily. _Yes of course I know what happened to Grimson! Do ye think I planned that?! Of course I didn't! I only wanted the Empire scum dead!_ Vitendo takes a deep breath.";
	text2 = "_Listen. If the demons aren't stopped they'll destroy all of Faerengrove. Please! I need yer help._";

 begintalknode 34;
	state = 25;
	nextstate = -1;
	question = "Dozens of people are dead, because of your idiocy! Die you scum!";
	text1 = "Vitendo shouts an alarm and raises his spear. It will not save the bastard!";
	action = END_TALK;
	code = make_town_hostile();
 break;

 begintalknode 41;
	state = 25;
	nextstate = 22;
	question = "The blood of those people is in your hands Vitendo. You remember that!";
	text1 = "_I know I know!_ Vitendo takes a deep breath. _This is exactly why we need your help. We cannot stop the demon lord by ourselves. Please help us!_";


		///***Horendo***///

 begintalknode 35;
	state = -1;
	nextstate = 35;
	question = "Horendo";
	text1 = "A middle-aged man is wandering around the caves. When he sees you he immediately approaches you. He stops right in front of your face, smiling madly. His eyes are spread wide open, as if he's insane.";
	text2 = "_I'm a wizard!_ He produces proudly. _The mighty wizard Horendo! Be careful lest I turn you into a toad!_";
	text5 = "_I can cast spells!_";
	action = INTRO;

 begintalknode 36;
	state = 35;
	nextstate = -1;
	question = "You're a wizard?";
	text1 = "_See my wizard's robes? Yes I am a wizard, a mighty wizard! ZAP!_";

 begintalknode 37;
	state = 35;
	nextstate = -1;
	question = "What's wrong with you?";
	text1 = "You doubt he even listened to what you said. Instead of answering he just goes on and on. _I'm a wizard! ZAP!_";

 begintalknode 38;
	state = 35;
	nextstate = 36;
	condition = get_flag(13,11) == 1;
	question = "I heard you summoned the haakai here in the first.";
	text1 = "Suddenly Horendo's mad smile dies down. He looks frightened, terribly frightened. He grabs his ears and wails. _NO! Nononono! I know nothing of that! IknownothingIknownothingIknowNOTHING!_";

 begintalknode 39;
	state = 36;
	nextstate = -1;
	question = "Alright! Calm down!";
	text1 = "The mad smile reappears on the wizard's face. _I'm a wizard!_ You think it's best if you just leave Horendo alone.";
	action = END_TALK;

 begintalknode 40;
	state = 36;
	nextstate = -1;
	question = "I know you summoned the demon and you will answer my questions!";
	text1 = "_Noo! No I know nothing!_ The wizard attacks you in panicked terror.";
	action = END_TALK;
	code = set_attitude(9,10);
		set_flag(13,12,1);
 break;